﻿<navigation:Page xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  x:Class="Sanctuary.EmployeeDialog" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           xmlns:local="clr-namespace:Sanctuary"
           Title="Employees Page" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" Loaded="Page_Loaded">
    <StackPanel x:Name="LayoutRoot">
        <StackPanel.Resources>
            <local:ImageConverter x:Key="ImageConverter" />
        </StackPanel.Resources>
        <StackPanel Orientation="Horizontal">
            <TextBlock>Sort By:</TextBlock>
            <RadioButton Tag="Strength" Checked="SortTheData">Strength</RadioButton>
            <RadioButton Tag="Knowledge" Checked="SortTheData">Knowledge</RadioButton>
            <RadioButton Tag="Personality" Checked="SortTheData">Personality</RadioButton>
        </StackPanel>
        <ListBox VerticalAlignment="Stretch" HorizontalAlignment="Left" Name="listBoxEmployees" ItemsSource="{Binding Path=Employees}" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Strength: " />
                                <TextBlock Text="{Binding Strength}" />
                            </StackPanel>
                            <ProgressBar Height="10" Maximum="255" Value="{Binding Strength}" Background="White" Foreground="Red" />
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Knowledge: " />
                                <TextBlock Text="{Binding Knowledge}" />
                            </StackPanel>
                            <ProgressBar Height="10" Maximum="255" Value="{Binding Knowledge}" Background="White" Foreground="Red" />
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Personality: " />
                                <TextBlock Text="{Binding Personality}" />
                            </StackPanel>
                            <ProgressBar Height="10" Maximum="255" Value="{Binding Personality}" Background="White" Foreground="Red" />
                        </StackPanel>
                        <Image Grid.Row="0" Grid.Column="1" Height="64" Width="64" Source="{Binding Path=Sex, Converter={StaticResource ImageConverter}}"></Image>
                        <StackPanel Grid.Row="0" Grid.Column="2" VerticalAlignment="Bottom">
                            <TextBlock Text="{Binding FirstName}"/>
                            <TextBlock Text="{Binding LastName}"/>
                            <Button Tag="{Binding EmployeeID}" HorizontalAlignment="Left">Hire</Button>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </StackPanel>
</navigation:Page>